<?php /*a:1:{s:61:"/www/wwwroot/www.moxiongdi.com/app/admin/view/node/index.html";i:1698050634;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php echo htmlentities($pagetitle); ?></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/admin.css" media="all">
</head>
<body>

	<div class="layui-fluid">
	<div class="layui-card">

	<div class="layui-form layui-card-header layuiadmin-card-header-auto">
	<div class="layui-form-item">


	  <div class="layui-inline">
		  <a class="layui-btn layuiadmin-btn-list iframe" href="<?php echo url('add',array('pid'=>$pid)); ?>" data-type="add">添加菜单</a>
	  </div>          
	</div>
	</div>

	<div class="layui-card-body">
	<form class="layui-form" action="<?php echo url('updateSort'); ?>" onsubmit="return save_form(this,success_fun)" lay-filter="component-form-element">
	<table class="layui-table">
	  <colgroup>
		<col width="150">
		<col width="150">
		<col width="200">
		<col>
	  </colgroup>
	  <thead>
		<tr>
		  <th class="center" width="5%">排序</th>
		  <th class="center" width="20%">名称</th>
		  <th class="center" width="20%">上级菜单</th>
		  <th class="center" width="20%">URL</th>
		  <th class="center" width="10%">显示</th>
		  <th class="center" width="10%">操作</th>
		</tr> 
	  </thead>
	  <tbody>
	  <?php foreach($data as $key=>$v): ?>
		<tr>
		  <td style="text-align:center;">
			  <input class="order_input" name="sort[]" value='<?php echo htmlentities($v['sort']); ?>'  autocomplete="off"  style="width:50px;text-align: center;">
			  <input name="id[]" type="hidden" value="<?php echo htmlentities($v['id']); ?>" />
			</td>
		  <td class="center tab-title" title="点击查看下一级"><a href="<?php echo url('index',array('pid'=>$v['id'])); ?>"><?php echo htmlentities($v['title']); ?></a></td>
		  <td class="center tab-title" title="点击查看上一级"><a href="<?php echo url('index',array('pid'=>$ppid)); ?>"><?php echo htmlentities($pagetitle); ?></a></td>
		  <td class="center"><?php echo htmlentities($v['name']); ?></td>                   
		  <td class="center">
			<input type="checkbox" name="status" lay-filter="status" value="<?php echo htmlentities($v['id']); ?>" class="status" title="显示" <?php if($v['status']): ?>checked<?php endif; ?>>
		  </td>
		  <td class="center">
			<a href="<?php echo url('update',array('id'=>$v['id'])); ?>" class="layui-btn layui-btn-sm iframe" title="修改页面"><i class="layui-icon">&#xe642;</i></a>
			<a href="<?php echo url('delete',array('id'=>$v['id'])); ?>" class="layui-btn layui-btn-sm ajax_del"><i class="layui-icon">&#xe640;</i></a>
		  </td>
		</tr>
	   <?php endforeach; ?>
	  </tbody>
	</table>
	  <div class="layui-inline">
		  <button class="layui-btn layuiadmin-btn-list" data-type="add">排序</button>
	  </div>    
	</form>				  
	</div>
      
	</div>
</div>

  <script src="/static/admin/layui/layui.js"></script>
  <script src="/static/js/jquery.min.js"></script>    
  <script src="/static/js/globals.js"></script>  
  <script>
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,element = layui.element
    ,form = layui.form;
    
    form.render(null, 'component-form-element');
    element.render('breadcrumb', 'breadcrumb');
    form.on('checkbox(status)', function(data){
      var checked=data.elem.checked;
	  var status=checked?1:0;
      var id=data.value;
      ajax_del("<?php echo url('setStatus'); ?>?id="+id+"&status="+status,function(msg,data){
		  layer.msg("设置成功");
	  });
    });

  });
  function success_fun(msg,data){
	layer.msg("设置成功");
	window.location.reload();
  }
  </script>

</body>
</html>
